import request from '@/sheep/request';

const StudentApi = {
  // 获得基本信息
  getStudentInfo: (params) => {
    return request({
      url: '/member/student/get',
      method: 'GET',
	  params,
      custom: {
        showLoading: false,
        auth: true,
      },
    });
  },
  getStudentPage: (params) => {
    return request({
      url: '/member/student/page',
      method: 'GET',
	  params,
      custom: {
        showLoading: false,
        auth: true,
      },
    });
  },
  // 创建学员
  createStudent: (data) => {
    return request({
      url: '/member/student/create',
      method: 'POST',
      data,
      custom: {
        showSuccess: true,
        successMsg: '保存成功'
      },
    });
  },
  // 删除学员
  deleteStudent: (id) => {
    return request({
      url: '/member/student/delete',
      method: 'DELETE',
      params: { id }
    });
  },
  // 修改学员
  updateStudent: (data) => {
    return request({
      url: '/member/student/update',
      method: 'PUT',
      data,
      custom: {
        loadingMsg: '验证中',
        showSuccess: true,
        successMsg: '更新成功'
      },
    });
  }
};
export default StudentApi;
